package com.todo.client.gui.dialog.user.account;

import com.extjs.gxt.ui.client.event.ButtonEvent;
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.form.TextField;
import com.extjs.gxt.ui.client.widget.toolbar.FillToolItem;
import com.todo.client.gui.dialog.AbstractDialog;

public class AccountDialog extends AbstractDialog{
	
	private TextField<String> login;
	private TextField<String> password;
	private TextField<String> cpassword;
	private TextField<String> email;
	
	public AccountDialog() {
		super();
		getDialog(MESSAGES.accountTitle());
        
        login = getTextField(MESSAGES.login());
        password = getTextField(MESSAGES.password());
        cpassword = getTextField(MESSAGES.cpassword());
        email = getTextField(MESSAGES.email());
        
        add(login);
        add(password);
        add(cpassword);
        add(email);
	}
	
	@Override
	protected void createButtons() {
		super.createButtons();
		getButtonBar().add(new FillToolItem());
		
		Button signup = getButton(MESSAGES.signup());
		signup.addSelectionListener(new SelectionListener<ButtonEvent>() {
			
			@Override
			public void componentSelected(ButtonEvent ce) {
				// TODO Auto-generated method stub
				
			}
		});
		
		Button cancel = getButton(MESSAGES.cancel());
		cancel.addSelectionListener(new SelectionListener<ButtonEvent>() {

			@Override
			public void componentSelected(ButtonEvent ce) {
				AccountDialog.this.hide();				
			}
		});
		
		addButton(signup);
		addButton(cancel);
	}
	
	@Override
	protected void validate() {
		// TODO Auto-generated method stub
		
	}

	@Override
	protected boolean hasValue() {
		// TODO Auto-generated method stub
		return false;
	}

	

}
